home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-04-16 | 1.1 KB | 39 lines | [TEXT/CWIE] |
- /// DemoIndex.cpp
- // Copyright: © 1994 - 1998 by Apple Computer, Inc., all rights reserved.
-
-
-
- #include "DemoIndex.h"
- //#pragma IA_BEGIN_IMPORTS
- #include <stdio.h>
- //#pragma IA_END_IMPORTS
-
- void DemoFlushProgressFn(float percent, void* data);
-
- void DemoFlushProgressFn(float percent, void* data) {
- #pragma unused (data)
- printf("flushing: %3.2f\n", percent);
- }
-
- DemoIndex::DemoIndex(IAStorage* storage, StringPtr rootFolder) :
-
- // glue together selected IACorpus, IAAnalysis and IAIndex implementations
- DEMOINDEXCLASS(storage,
- rootFolder ? new DEMOCORPUS(rootFolder) : new DEMOCORPUS(),
- new DEMOANALYSIS()) {
-
- // initialize flush progress parameters
- SetFlushProgressFn(&DemoFlushProgressFn);
- SetFlushProgressFreq(CLOCKS_PER_SEC); // one report per second
- }
-
- void DemoIndex::AddDoc(IADoc* doc) {
- printf("adding %#s\n", ((HFSDoc*)doc)->GetFileName());
- DEMOINDEXCLASS::AddDoc(doc); // run super
- }
-
- void DemoIndex::DeleteDoc(const IADoc* doc) {
- printf("deleting %#s\n", ((HFSDoc*)doc)->GetFileName());
- DEMOINDEXCLASS::DeleteDoc(doc); // run super
- }
-